<template>
  <div>
    <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="全部文件" name="first" ><router-view></router-view></el-tab-pane>
      <el-tab-pane label="图片" name="second"><router-view></router-view></el-tab-pane>
      <el-tab-pane label="视频" name="third"><router-view></router-view></el-tab-pane>
      <el-tab-pane label="文档" name="fourth"><router-view></router-view></el-tab-pane>
      <el-tab-pane label="其他" name="five"><router-view></router-view></el-tab-pane>
      <el-tab-pane label="新建文件夹" name="six">
        <el-button @click="drawer = true" type="primary" style="margin-left: 16px;">
          点我新建
        </el-button>
        <el-drawer
            title="nonono~"
            :visible.sync="drawer"
            :with-header="false">
          <span style="" >功能待完善哦~</span>
          <div style="height: 500px;width: 500px; " align="center">
          <img src="../../public/img/xyb.jpg" width="500px" height="500px">

          </div>
        </el-drawer>

      </el-tab-pane>
    </el-tabs>

  </div>

</template>
<script>

export default {
  created() {
    this.$router.push("/UserFileList")
  },
  data() {
    return {
      drawer:false,
      activeName: 'first'
    };
  },
  methods: {
    handleClick(tab, event) {
   if (tab.name==='first'){
     this.$router.push("/UserFileList")
   }else if (tab.name==='second'){
     this.$router.push("/Images")
   }else if (tab.name==='third'){
     this.$router.push("/Videos")
   }else if (tab.name==='fourth'){
     this.$router.push("/Texts")
   }else {
     this.$router.push("/Others")
   }
    }
  }
};
</script>